package com.cy.store.repository;

import com.cy.store.entity.Product;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface ProductRepository extends JpaRepository<Product, Integer> {
    //销量查询商品
    @Query(value = "SELECT * FROM product WHERE status=1 ORDER BY priority DESC LIMIT 0,4", nativeQuery = true)
    List<Product> findHotList();
}
